package packing;


public class BoxPack extends BoxPressure implements Comparable<BoxPack>{
	
	int id;
	
	
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public BoxPack(int id, int width, int length, int height, int weight, int pressure) {
		
		super(width, length, height, weight, pressure);
		this.id = id;

	}

	

	@Override
	public String toString() {
//		return "BoxPack [id=" + id + ", width=" + width + ", length=" + length
//				+ ", height=" + height + "]\n";
		return "BoxPack : id=" + id + ", ความกว้าง =" + width + ", ความยาว =" + length
				+ ", ความสูง =" + height + ", น้ำหนัก="+weight+", การรับแรงกดทับ="+pressure+"\n";
	}

	@Override
	public int compareTo(BoxPack o) {
		if(this.getWidth()>o.getWidth()){
			return -1;
		}else if(this.getWidth()<o.getWidth()){
			return 1;
		}else if(this.getLength()>o.getLength()){
			return -1;
		}else if(this.getLength()<o.getLength()){
			return 1;
		}else if(this.getHeight()>o.getHeight()){
			return -1;
		}else if(this.getHeight()<o.getHeight()){
			return 1;
		}else  if(this.getId()>o.getId()){
			return -1;
		}else if(this.getId()<o.getId()){
			return 1;
		}
//		System.out.println("There is one pack is equal " + this + " " + o);
		return 0;
	}
	
	
	

}
